/**
 * Logout Controller (Example).
 */
class LogoutController {

  def authenticateService;
  
  /**
   * Index action. Redirects to the Spring security logout uri.
   */
  def index = {
    redirect(uri: '/j_spring_security_logout')
  }
	
  def afterLogout = {
    def backFromCasLogoutUrl = grailsApplication.config.grails.serverURL
    
    def conf = authenticateService.securityConfig.security
    
    def casLogoutUrl = "$conf.cas.fullServiceURL/logout?url=$backFromCasLogoutUrl"

    [casLogoutUrl:casLogoutUrl]
  }
}
